package com.guomao.filedemos;

import java.io.File;
import java.io.FilenameFilter;

public class FileDemoF {


    public static void main(String[] args) {


        File file = new File("D://");

        File[] files = file.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
//                System.out.println(dir+":"+name);
                return name.contains("program");
            }
        });

        for (File s : files) {
            System.out.println(s);
        }

//        String[] files = file.list();
//        for (String s : files) {
//            System.out.println(s);
//        }

//        File[] files = file.listFiles();
//        for (File f : files) {
//            System.out.println(f.isDirectory());
//            System.out.println(f.isFile());
//            System.out.println(new Date(f.lastModified()));
//        }


    }

}
